package com.zpark.test;

import com.zpark.service.IAccountService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @PackageName: com.zpark.test
 * @ClassName: MainApp
 * @Description:
 * @author: RZS
 * @date: 2023/4/3  15:33
 */
public class MainApp {
    public static void main(String[] args) {
        // 获取spring容器对象
        ClassPathXmlApplicationContext app = new ClassPathXmlApplicationContext("beans.xml");
        // 根据id获取bean
        IAccountService accountService = app.getBean("accountService", IAccountService.class);
        // 使用bean
        accountService.transfer(1, 2, 200.0);
    }
}
